package com.grade.controller;

import com.grade.utils.Results;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;


@Controller
@RequestMapping("/usr")
@ResponseBody
public class CommController {
    @RequestMapping("/gelatinous")
    public Results show(HttpSession session) {
        Object use = session.getAttribute("usr");
        return new Results("0", "查询成功", use, null);
    }

    @RequestMapping("/loginOut")
    public Results loginOut(HttpSession session) {
        session.invalidate();
        return new Results<>("0","执行成功");
    }
}
